﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using qiupeng.Public;
using System.IO;

public partial class HumanManage_Staff_list_show_print : Base
{
    Db List = new Db();
    BindDrowDownList list = new BindDrowDownList();
    public static string fjkey, XinagPian;
    public string showjg;
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!Page.IsPostBack)
        {
            if (this.Session["username"] == null)
            {
                base.Response.Write("<script language=javascript>alert('登陆超时！');window.parent.location = '../main_d.aspx'</script>");
            }
            else
            {

                if (!this.Page.IsPostBack)
                {
                    string str = "select * from qp_hr_Staff where id='" + this.List.GetFormatStr(base.Request.QueryString["id"]) + "'";
                    OleDbDataReader reader = this.List.GetList(str);
                    if (reader.Read())
                    {
                        this.Number.Text = reader["Number"].ToString();
                        this.GongHao.Text = reader["GongHao"].ToString();
                        this.XingMing.Text = reader["XingMing"].ToString();
                        this.XingBie.Text = reader["XingBie"].ToString();
                        this.HunYin.Text = reader["HunYin"].ToString();
                        this.ChuSheng.Text = DateTime.Parse(reader["ChuSheng"].ToString()).ToShortDateString();
                        this.JiGuan.Text = reader["JiGuan"].ToString();
                        this.MinZhu.Text = reader["MinZhu"].ToString();
                        this.JianKan.Text = reader["JianKan"].ToString();
                        this.ZhengZhi.Text = reader["ZhengZhi"].ToString();
                        this.ShenFen.Text = reader["ShenFen"].ToString();
                        this.GongZuoShiJian.Text = reader["GongZuoShiJian"].ToString();
                        this.GongZuoNianXian.Text = reader["GongZuoNianXian"].ToString();
                        this.WenHua.Text = reader["WenHua"].ToString();
                        this.BiYe.Text = reader["BiYe"].ToString();
                        this.ZhuanYe.Text = reader["ZhuanYe"].ToString();
                        this.BiYeShiJian.Text = reader["BiYeShiJian"].ToString();
                        this.SuoXueWaiYu.Text = reader["SuoXueWaiYu"].ToString();
                        this.WaiYu.Text = reader["WaiYu"].ToString();
                        this.ZhangWo.Text = reader["ZhangWo"].ToString();
                        this.JiSuanJiDj.Text = reader["JiSuanJiDj"].ToString();
                        this.RenCaiFenLei.Text = reader["RenCaiFenLei"].ToString();
                        this.RenCaiDengJi.Text = reader["RenCaiDengJi"].ToString();
                        this.SuoHuoZhenShu.Text = reader["SuoHuoZhenShu"].ToString();
                        this.JiaoYuJIanLi.Text = reader["JiaoYuJIanLi"].ToString();
                        this.TeChang.Text = reader["TeChang"].ToString();
                        this.AiHao.Text = reader["AiHao"].ToString();
                        this.Email.Text = reader["Email"].ToString();
                        this.LianXiDiZhi.Text = reader["LianXiDiZhi"].ToString();
                        this.LianXIDianHua.Text = reader["LianXIDianHua"].ToString();
                        this.YouBian.Text = reader["YouBian"].ToString();
                        this.ShenGao.Text = reader["ShenGao"].ToString();
                        this.TiZhong.Text = reader["TiZhong"].ToString();
                        this.XueXing.Text = reader["XueXing"].ToString();
                        this.GongZuoYQ.Text = reader["GongZuoYQ"].ToString();
                        this.DaoGangRQ.Text = DateTime.Parse(reader["DaoGangRQ"].ToString()).ToShortDateString();
                        this.YinPinBMId.Text = reader["YinPinBMId"].ToString();
                        this.YinPinBM.Text = reader["YinPinBM"].ToString();
                        this.YinPinZW.Text = reader["YinPinZW"].ToString();
                        this.ZhiCheng.Text = reader["ZhiCheng"].ToString();
                        this.Zhiwu.Text = reader["Zhiwu"].ToString();
                        this.YgZhuangTai.Text = reader["YgZhuangTai"].ToString();
                        this.JbGongZ.Text = reader["JbGongZ"].ToString();
                        this.BeiZhu.Text = this.List.TbToLb(reader["BeiZhu"].ToString());
                        XinagPian = reader["XiangPian"].ToString();
                        this.YgGongZ.Text = reader["YgGongZ"].ToString();
                        this.Shgx.Text = this.List.TbToLb(reader["Shgx"].ToString());
                        this.Gzjl.Text = this.List.TbToLb(reader["Gzjl"].ToString());
                        this.Xxjl.Text = this.List.TbToLb(reader["Xxjl"].ToString());
                        this.KaiHu.Text = reader["KaiHu"].ToString();
                        this.ZhangHao.Text = reader["ZhangHao"].ToString();
                        this.lblzhiweileibie.Text = reader["zhiweileibie"].ToString();
                    }
                    reader.Close();
                    string str2 = "select  * from qp_hr_fileupload where KeyField='" + this.Number.Text + "' order by id desc";
                    OleDbDataReader reader2 = this.List.GetList(str2);
                    this.fujian.Text = null;
                    int num = 0;
                    this.fujian.Text = this.fujian.Text + "<table width=100% border=0 cellspacing=0 cellpadding=4>";
                    this.fujian.Text = this.fujian.Text + "<tr>";
                    while (reader2.Read())
                    {
                        string text = this.fujian.Text;
                        this.fujian.Text = text + " <td width=100% >\x00b7<a href=../file_down.aspx?number=" + reader2["NewName"].ToString() + "  target=_blank>" + reader2["Name"].ToString() + "</a></td>";
                        num++;
                        if (num == 1)
                        {
                            this.fujian.Text = this.fujian.Text + "</tr><TR>";
                            num = 0;
                        }
                    }
                    this.fujian.Text = this.fujian.Text + " </table>";
                    reader2.Close();
                }
                string sql = "select  * from qp_hr_SysFieldDIYAdd where keyfile='" + this.Number.Text + "'  order by PaiXun asc";
                OleDbDataReader list = this.List.GetList(sql);
                this.showjg = null;
                if (list.Read())
                {
                    string str4 = "select  * from qp_hr_SysFieldDIYAdd where keyfile='" + this.Number.Text + "'  order by PaiXun asc";
                    OleDbDataReader reader4 = this.List.GetList(str4);
                    int num2 = 0;
                    this.showjg = this.showjg + "<tr> <td align=center bgcolor=#efefef class=cpx12hei colspan=4 height=26 width=33%><div align=center><strong>用户自定义字段</strong></div> </td> </tr>";
                    while (reader4.Read())
                    {
                        object showjg = this.showjg;
                        this.showjg = string.Concat(new object[] { showjg, " <tr> <td align=right bgcolor=#cccccc class=cpx12hei height=17 nowrap=nowrap width=17%>", reader4["Name"], "：</td> <td bgcolor=#efefef class=cpx12hei height=17 width=33% colspan=3>", this.List.TbToLb(reader4["ivalue"].ToString()), "</td></tr>" });
                        num2++;
                        if (num2 == 1)
                        {
                            num2 = 0;
                        }
                    }
                    reader4.Close();
                }
                list.Close();
            }
        }
    }
}
